/*******************************************************************************
*  file    : moletask.cpp
*  created : 26.08.2013
*  author  : Slyshyk Oleksiy (alexSlyshyk@gmail.com)
*******************************************************************************/

#include "moletask.hpp"

MoleTask::MoleTask() :
    id_     (0),
    request_(0),
    status_ (0),
    ansver_ (0),
    request_dev_id_(0)
{
}
int MoleTask::id() const
{
    return id_;
}

void MoleTask::setId(int id)
{
    id_ = id;
}
int MoleTask::status() const
{
    return status_;
}

void MoleTask::setStatus(int status)
{
    status_ = status;
}
int MoleTask::ansver() const
{
    return ansver_;
}

void MoleTask::setAnsver(int ansver)
{
    ansver_ = ansver;
}
QDateTime MoleTask::startTime() const
{
    return start_time_;
}

void MoleTask::setStartTime(const QDateTime &start_time)
{
    start_time_ = start_time;
}
QString MoleTask::requestText() const
{
    return request_text_;
}

void MoleTask::setRequestText(const QString &request_text)
{
    request_text_ = request_text;
}
QString MoleTask::requestNum() const
{
    return request_num_;
}

void MoleTask::setRequestNum(const QString &request_num)
{
    request_num_ = request_num;
}
int MoleTask::requestDevId() const
{
    return request_dev_id_;
}

void MoleTask::setRequestDevId(int request_dev_id)
{
    request_dev_id_ = request_dev_id;
}

QString MoleTask::toString() const
{
    QString res;
    res.append(QString("%1:%2").arg(request_text_).arg(start_time_.toString("yyyy-MM-dd hh:mm:ss")));
    return res;
}

bool MoleTask::operator==(const MoleTask &other) const
{
    return (
                (id_             == other.id_             )&&
                (request_        == other.request_        )&&
                (status_         == other.status_         )&&
                (ansver_         == other.ansver_         )&&
                (request_dev_id_ == other.request_dev_id_ )&&
                (start_time_     == other.start_time_     )&&
                (request_num_    == other.request_num_    )&&
                (request_text_   == other.request_text_   )
            );
}

bool MoleTask::operator!=(const MoleTask &other) const
{
    return !(this->operator==(other));
}







